<?php


namespace backend\modules\tool\controllers;


use backend\modules\tool\excel\ExcelToolController;
use backend\modules\tool\helpers\AssetsAutoPublish;
use backend\modules\tool\models\DataSourceTask;
use backend\modules\tool\models\Node;
use backend\modules\tool\models\Queue;
use backend\modules\tool\models\SqlConfig;
use yii\console\Controller;

class PublishController extends Controller
{
    public function SetExcelModel()
    {
        // TODO: Implement SetExcelModel() method.
    }

    public function actionIndex(){
        AssetsAutoPublish::publishVender(true);
        AssetsAutoPublish::publish(true);
        $list=[
            Queue::class,
            DataSourceTask::class,
            SqlConfig::class,
            Node::class
        ];
        foreach ($list as $value){
            echo $value::$create_sql;
            \Yii::$app->db->createCommand($value::$create_sql)->execute();
        }
        echo "Table has been created !!";
    }
}